package com.order.order.controller;

import com.order.order.Feign.FeignFeignClient;
import com.order.order.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.ws.rs.POST;

@RestController
@RequestMapping("/feign")
public class Feign {

    @Autowired
    private FeignFeignClient feignFeignClient;

    @RequestMapping("/feign")
    public String feign() {
        return this.feignFeignClient.test("大佬");
    }

    @RequestMapping(value="/test2/{id}",method = RequestMethod.GET)
    public String feign2(@PathVariable("id") Long id) {
        return this.feignFeignClient.test2(id);
    }

    @RequestMapping(value="/test4/{string}",method = RequestMethod.GET)
    public String feign4(@PathVariable("string") String string) {
        return this.feignFeignClient.test4(string);
    }

    @RequestMapping(value = "/test3/{id}",method = RequestMethod.GET)
    public User feign3(@PathVariable("id") Long id) {
        return this.feignFeignClient.test3(id);
    }

}
